class Solution:
    def missingNumber(self, nums: list) -> int:
        mid_set = set(nums)
        for i in range(len(nums) + 1):
            if i not in mid_set:
                return i


a = Solution()
print(a.missingNumber([9, 6, 4, 2, 3, 5, 7, 0, 1]))
